package com.example.day45.sensor;

import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;

import com.example.day45.R;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EActivity;

/**
 *
 */
@EActivity(R.layout.activity_sensor)
public class SensorActivity extends AppCompatActivity implements ShakeListener.ShakeCallback {
    private final int defaultAccelerometerValue = 14;

    @AfterViews
    public void init() {
        ShakeListener.getInstance(this, this).registerListener();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        ShakeListener.getInstance(this, this).unRegisterListener();
    }

    @Override
    public void onShakeCallback() {
        Toast.makeText(SensorActivity.this, "约吗???", Toast.LENGTH_SHORT).show();
    }
}
